<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js" type="application/javascript"></script>
    <script src="https://lib.baomitu.com/socket.io/2.3.0/socket.io.js" type="application/javascript"></script>

    <script>
        $(function(){
            
            var socket =  io.connect('http://127.0.0.1:9092');
            //监听名为hello的事件，这与服务端推送的那个事件名称必须一致
            socket.on("hello", function(data){
                console.log(data);
               var info= document.getElementById("info");
               info.innerHTML=data;
                //$('#x').text(data.x);
                //$('#y').text(data.y);

            });
        });

    </script>
</head>
<body>
	<div>
	<p id="info">init</p>
	</div>
    <div id="display" style="height:50px;">
        x=<span id="x">0</span>, y=<span id="y">0</span>
    </div>

</body>
</html>